<script setup lang="ts">
import { inject, type Ref } from 'vue';

const money = inject<Ref<number, number>>('money')
const changeMoney = inject<(newValue: number) => void>('changeMoney')
const change = () => {
    changeMoney?.(100)
}

</script>

<template>
    <div class="child-page" style="padding: 50px; border: 10px solid #ccc">
        child 组件 --{{ money }}
        <button @click="change">修改价钱</button>
    </div>
</template>